import request from '@/utils/request';
import config from '@/env/config';
import { IUserinfo } from '@/types';

/**
 * 获取用户详情
 * @returns string
 */
export function getUserinfo(): Promise<IUserinfo> {
  return request({
    method: 'post',
    url: `${config.SERVICE_API}api/user/query`,
    isTransformResponse: true,
  });
}

/**
 * 修改用户信息
 * @returns string
 */
export function updateUserinfo(data): Promise<boolean> {
  return request({
    data,
    method: 'post',
    url: `${config.SERVICE_API}api/user/update`,
  });
}
